package com.java.mall_imooc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.java.mall_imooc.common.utils.PageUtils;
import com.java.mall_imooc.entity.OrderItem;
import com.java.mall_imooc.mapper.OrderItemDao;
import com.java.mall_imooc.service.OrderItemService;
import org.springframework.stereotype.Service;

@Service("orderItemService")
public class OrderItemServiceImpl extends ServiceImpl<OrderItemDao, OrderItem> implements OrderItemService {

    @Override
    public PageUtils queryPage(OrderItem orderItem, Integer pageNum, Integer pageSize) {
        IPage<OrderItem> page = this.page(
                new Page<>(pageNum, pageSize),
                new QueryWrapper<OrderItem>() // 拼接查询条件
        );

        return new PageUtils(page);
    }

}